#include"professor.h"
#include<unistd.h>
#include<string.h>
#define SIZE 101
#define STYLE '#'
#define USLEEP 40*1000
const char*str="|/-\\";
void processor()
{
  int rate=0;
  char bar[SIZE];
  memset(bar,'\0',sizeof(bar));
  int num=strlen(str);
  while(rate<101)
  {
    printf("[%-100s][%d%%][%c]\r",bar,rate,str[rate%num]);
    fflush(stdout);
    usleep(USLEEP);
    bar[rate++]=STYLE;
  }
  printf("\n");
}
